package com.solairen.myapplication.Pager.HomePager;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.solairen.myapplication.Pager.DiagnosisRecordActivity;
import com.solairen.myapplication.PersonnelAbout;
import com.solairen.myapplication.R;
import com.solairen.myapplication.SettingActivity;

public class PersonalFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_personal,container,false);
        TextView settingsButton = rootView.findViewById(R.id.setting_button);
        TextView historyButton =  rootView.findViewById(R.id.diag_history);
        TextView aboutButton = rootView.findViewById(R.id.about_personnel);
        TextView userName = rootView.findViewById(R.id.usernameTextView);

        /**********setting***********/
        settingsButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), SettingActivity.class);
                startActivity(intent);
            }
        });

        /*******diagHistory***********/
        historyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), DiagnosisRecordActivity.class);
                startActivity(intent);
            }
        });

        /********about*****************/
        aboutButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), PersonnelAbout.class);
                startActivity(intent);
            }
        });

//        /**************change***********/
//
//        userName.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//
//            }
//        });

        return rootView;
    }
}

